package com.zhangxun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhangxun.domain.PickAddr;
import com.zhangxun.service.PickAddrService;
import com.zhangxun.mapper.PickAddrMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
* @author 张循
* @description 针对表【pick_addr(用户配送地址)】的数据库操作Service实现
* @createDate 2023-01-05 18:32:47
*/
@Service
public class PickAddrServiceImpl extends ServiceImpl<PickAddrMapper, PickAddr>
    implements PickAddrService{

    @Autowired
    private PickAddrMapper pickAddrMapper;
    @Override
    public Page<PickAddr> selectPage(Page<PickAddr> page, PickAddr pickAddr) {
        page = pickAddrMapper.selectPage(page,new LambdaQueryWrapper<PickAddr>()
                .like(StringUtils.hasText(pickAddr.getAddrName()),PickAddr::getAddrName,pickAddr.getAddrName()));

        return page;
    }
}




